﻿package mortal.game.view.guild.cellrender
{
    import Message.Game.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.text.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.common.tools.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;

    public class GuildWareHouseRecListRenderer extends GuildCellRenderer
    {
        private var _txtDate:GTextFiled;
        private var _txtOprName:GTextFiled;
        private var _txtDealName:GTextFiled;
        private var _txtItemName:GTextFiled;
        private var _txtOprType:GTextFiled;

        public function GuildWareHouseRecListRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            var _loc_1:* = GlobalStyle.textFormatLv;
            _loc_1.align = TextFormatAlign.CENTER;
            this._txtDate = UIFactory.textField("12-25 16:45", 0, 5, 85, 22, this, _loc_1);
            _loc_1.color = GlobalStyle.colorBaiUint;
            this._txtOprName = UIFactory.textField("", 95, 5, 95, 22, this, _loc_1);
            this._txtDealName = UIFactory.textField("", 190, 5, 95, 22, this, _loc_1);
            this._txtItemName = UIFactory.textField("", 280, 5, 115, 22, this);
            this._txtOprType = UIFactory.textField("" + Language.getString(71118), 415, 5, 44, 22, this, _loc_1);
            UIFactory.bg(0, 31, 480, 1, this, ImagesConst.SplitLine);
            return;
        }// end function

        override public function get data() : Object
        {
            return super.data;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:SGuildWarehouseRecord = null;
            super.data = param1;
            if (param1 == null)
            {
                return;
            }
            if (param1 is SGuildWarehouseRecord)
            {
                _loc_2 = param1 as SGuildWarehouseRecord;
                if (_loc_2.itemCode == 0)
                {
                    this._txtItemName.htmlText = "<p align = \'center\'>" + GameDefConfig.instance.getEPrictNameAddColoer(_loc_2.unit) + "*" + HTMLUtil.addColor(_loc_2.amount.toString(), GlobalStyle.colorBai) + "</p>";
                }
                else
                {
                    this._txtItemName.htmlText = "<p align = \'center\'>" + ItemsUtil.getItemName(new ItemData(_loc_2.itemCode)) + "*" + HTMLUtil.addColor(_loc_2.amount.toString(), GlobalStyle.colorBai) + "</p>";
                }
                this._txtOprName.text = _loc_2.startName;
                this._txtDealName.text = _loc_2.endName;
                this._txtDate.text = DateParser.parse(_loc_2.operDt, "MM-dd hh:mm");
                this._txtOprType.text = GuildConst.getWareHouseOperTypeName(_loc_2.oper);
            }
            return;
        }// end function

    }
}
